<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>固定定位</title>
    <style>
        body{
            height: 2000px;
        }
        .box1{
            width: 200px;
            height: 200px;
            background-color: red;
            position: fixed;
            right: 200px;
            bottom: 200px;
        }
        .box2{
            width:200px;
            height:200px;
            background-color: aqua;
            position: absolute;
            right: 200px;
            bottom: 500px;
        }
        .box3{
            width:200px;
            height:200px;
            background-color: blue;
            position: relative;
            left: 1200px;
            top: 300px;
        }
    </style>
</head>
<body>
    <p>固定定位为脱离文档流，会产生覆盖的情况，谁的 HTML代码在后面就是谁覆盖另外一个。会固定在屏膜的某一个位置，不会随着页面的滚动而滚动。</p>
    <div class="box2">绝对定位</div>
    <div class="box3">相对定位</div>
    <div class="box1">固定定位</div>
</body>
</html>